/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Dominio.Entidades;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author Juan Andres Pio
 */
public class ArchivoLectura {

    private BufferedReader in;
    private String linea = "";

    public ArchivoLectura(String unNombre) {
        try {
            in = new BufferedReader(new FileReader(unNombre));
        } catch (IOException e) {

            System.out.println("no esta");
        }
    }

    public String linea() {
        return linea;
    }

    public boolean hayMasLineas() {
        boolean hayMas = true;

        try {
            linea = in.readLine();
        } catch (IOException e) {
            linea = null;
        }

        hayMas = (linea != null);

        return hayMas;
    }
    
  

    public boolean cerrar() {
        boolean ok = true;

        try {
            in.close();
        } catch (Exception e) {
            System.out.print("error close");
            ok = false;
        }
        return ok;
    }
}
